/**
 * @author wn
 * @date 2023/08/07 11:54:35
 * @description: 猜你喜欢组合式函数
 */

import type { XtxGuessInstance } from '@/types/components'
import { ref } from 'vue'

/**
 * 返回组件实例 下拉刷新 上拉加载
 * @returns {}
 */
export const useGuess = () => {
	// 获取猜你喜欢组件实例
	const guessRef = ref<XtxGuessInstance>()

	// 下拉刷新
	const refresh = () => guessRef.value?.resetData()

	// 上拉加载
	const getMore = () => guessRef.value?.getMore()

	return { guessRef, refresh, getMore }
}
